package com.isoft.demo.dao;

import com.isoft.demo.entity.Transport;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.Date;
import java.util.List;

public interface FindTransferCusDao {

    @Select("SELECT tid,oidt,fidt,tdate,sdate FROM transport t " +
            "JOIN vehicle v ON t.vidt=v.vid " +
            "JOIN employee e ON t.eidt=e.eid")
    List<Transport> findTranCus();

    @Select("SELECT tid,oidt,fidt,tdate,sdate FROM transport t " +
            "JOIN vehicle v ON t.vidt=v.vid " +
            "JOIN employee e ON t.eidt=e.eid " +
            "WHERE tid=#{tid}")
    List<Transport> findTranCusById(int tid);

    @Update("UPDATE transport " +
            "SET sdate=#{sdate} " +
            "WHERE tid=#{tid}")
    int confirmDate(String sdate,int tid);

}
